<?php

require_once 'Base.php';

class OrderGoodsModel extends Base {
	
	public function getListByIds($ids = []){
		
		$this->where(['orderid in (?)' => $ids]);
		$this->join('shop_goods', 'shop_goods.id=shop_order_goods.goodsid','shop_goods.name');
		$data = $this->select();
		$list = [];
		foreach($data as $val){
			$list[$val['orderid']] .= $val['total'].'*'.$val['name'].' ';
		}
		
		return $list;
	}
}
